package com.hwua.tonyshop.criteria;
	
import com.slkj.autocode.entity.Page;
import com.hwua.tonyshop.entity.pojo.Banner;

/**
* 
* @author sunny Yang [杨松彦]
* @QQ 550358261
* @date 2018-04-16
* @discribe
* >、<、>=、<=、=、!=、like、
* is null、is not null、in、not in
*
*/
public class BannerCriteria extends Banner{
	/**
	* 版本号
	*/
	private static final long serialVersionUID = 1L;
	private String groupBy123;//分组
	private String having123;//分组过滤
	private String orderBy123;//排序
	private Page page123;
	private String condition123="";//纯条件
	private String selectCondition123;//查询条件
	private String sql123;
	private Banner banner;
	private String feid123;//字段用于统计查询时设置

	public BannerCriteria() {

	}
	public String getFeid123() {
		return feid123;
	}
	public void setFeid123(String feid) {
		this.feid123 = feid;
	}
	public Banner getBanner() {
		return banner;
	}
	public void setBanner(Banner banner) {
		this.banner = banner;
		initBanner(banner);
	}

	public String getSql123() {
		return sql123;
	}

	public void setSql123(String sql123) {
		this.sql123 = sql123;
	}

	public String getSelectCondition123() {
		if(selectCondition123==null){
			if(condition123.trim().length()>0){
				condition123 = "where "+condition123;
			}
			selectCondition123 = condition123;
			if(groupBy123!=null){
				selectCondition123 += " group by "+groupBy123+" ";
			}
			if(having123!=null){
				selectCondition123 += "having "+having123+" ";
			}
			if(orderBy123!=null){
				selectCondition123 += "order by "+orderBy123+" ";
			}
			if(page123!=null){
				selectCondition123 += "limit "+((page123.getPageNumber()-1)*page123.getPageSize())+","+page123.getPageSize();
			}
			selectCondition123 = selectCondition123.trim();
		}
		System.out.println("查询条件："+selectCondition123);
		return selectCondition123;
	}
	public void setSelectCondition123(String selectCondition) {
		this.selectCondition123 = selectCondition;
	}
	public String getCondition123() {
		System.out.println("纯条件："+condition123);
		return condition123;
	}
	public void setCondition123(String condition) {
		this.condition123 = condition;
	}
	public BannerCriteria page(Page value){
		page123 = value;
		return this;
	}
	public BannerCriteria groupBy(String value){
		groupBy123 = value;
		return this;
	}
	public BannerCriteria having(String value){
		having123 = value;
		return this;
	}
	public BannerCriteria orderBy(String value){
		orderBy123 = value;
		return this;
	}

	/*public String getSqlAll(String tableName){
		String sql = "";
		if("where ".equals(condition123)){
			sql = "select * from `"+tableName+"` ";
		}else{
			sql = "select * from `"+tableName+"` "+condition123+" ";
		}
		if(groupBy123!=null){
			sql += sql+" group by "+groupBy123+" ";
		}
		if(having123!=null){
			sql += "having "+having123+" ";
		}
		if(orderBy123!=null){
			sql += "order by "+orderBy123+" ";
		}
		if(page123!=null){
			sql += "limit "+((page123.getPageNumber()-1)*page123.getPageSize())+","+page123.getPageSize();
		}
		sql = sql.trim();
		return sql; 
	}*/

/************以下为纯条件的拼接*******************/

	public BannerCriteria andIdEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`="+id+" ";
			}else{
				condition123 += "`id`="+id+" ";
			}
		}
		return this;
	}
	
	public BannerCriteria orIdEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`="+id+" ";
			}else{
				condition123 += "`id`="+id+" ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIdNotEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`!="+id+" ";
			}else{
				condition123 += "`id`!="+id+" ";
			}
		}
		return this;
	}
	public BannerCriteria orIdNotEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`!="+id+" ";
			}else{
				condition123 += "`id`!="+id+" ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andIdGreaterThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`>"+id+" ";
			}else{
				condition123 += "`id`>"+id+" ";
			}
		}
		return this;
	}
	public BannerCriteria orIdGreaterThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`>"+id+" ";
			}else{
				condition123 += "`id`>"+id+" ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andIdLessThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`<"+id+" ";
			}else{
				condition123 += "`id`<"+id+" ";
			}
		}
		return this;
	}
	public BannerCriteria orIdLessThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`<"+id+" ";
			}else{
				condition123 += "`id`<"+id+" ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIdGreadterThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`>="+id+" ";
			}else{
				condition123 += "`id`>="+id+" ";
			}
		}
		return this;
	}
	public BannerCriteria orIdGreadterThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`>="+id+" ";
			}else{
				condition123 += "`id`>="+id+" ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIdLessThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`<="+id+" ";
			}else{
				condition123 += "`id`<="+id+" ";
			}
		}
		return this;
	}
	public BannerCriteria orIdLessThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`<="+id+" ";
			}else{
				condition123 += "`id`<="+id+" ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIdLike(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id` like "+id+" ";
			}else{
				condition123 += "`id` like "+id+" ";
			}
		}
		return this;
	}
	public BannerCriteria orIdLike(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id` like "+id+" ";
			}else{
				condition123 += "`id` like "+id+" ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIdIsNull(){
			if(condition123.length()>0){
				condition123 += "and `id` is null";
			}else{
				condition123 += "`id` is null";
			}
		return this;
	}
	public BannerCriteria orIdIsNull(){
		if(condition123.length()>0){
			condition123 += "or `id` is null";
		}else{
			condition123 += "`id` is null";
		}
		return this;
	}
	public BannerCriteria andIdIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `id` is not null";
		}else{
			condition123 += "`id` is not null";
		}
		return this;
	}
	public BannerCriteria orIdIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `id` is not null";
		}else{
			condition123 += "`id` is not null";
		}
		return this;
	}
	public BannerCriteria andIdIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `id` in("+value+") ";
			}else{
				condition123 += "`id` in("+value+") ";
			}
		}
		return this;
	}
	public BannerCriteria orIdIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `id` in("+value+") ";
			}else{
				condition123 += "`id` in("+value+") ";
			}
		}
		return this;
	}
	public BannerCriteria andIdNotIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `id` not in("+value+") ";
			}else{
				condition123 += "`id` not in("+value+") ";
			}
		}
		return this;
	}
	public BannerCriteria orIdNotIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `id` not in("+value+") ";
			}else{
				condition123 += "`id` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andNameEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`='"+name+"' ";
			}else{
				condition123 += "`name`='"+name+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orNameEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`='"+name+"' ";
			}else{
				condition123 += "`name`='"+name+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andNameNotEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`!='"+name+"' ";
			}else{
				condition123 += "`name`!='"+name+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orNameNotEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`!='"+name+"' ";
			}else{
				condition123 += "`name`!='"+name+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andNameGreaterThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`>'"+name+"' ";
			}else{
				condition123 += "`name`>'"+name+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orNameGreaterThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`>'"+name+"' ";
			}else{
				condition123 += "`name`>'"+name+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andNameLessThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`<'"+name+"' ";
			}else{
				condition123 += "`name`<'"+name+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orNameLessThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`<'"+name+"' ";
			}else{
				condition123 += "`name`<'"+name+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andNameGreadterThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`>='"+name+"' ";
			}else{
				condition123 += "`name`>='"+name+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orNameGreadterThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`>='"+name+"' ";
			}else{
				condition123 += "`name`>='"+name+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andNameLessThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`<='"+name+"' ";
			}else{
				condition123 += "`name`<='"+name+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orNameLessThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`<='"+name+"' ";
			}else{
				condition123 += "`name`<='"+name+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andNameLike(String name){
		if(name!=null&&name.trim().length()>0&&!("%".equals(name.trim()))&&!("%%".equals(name.trim()))){
			if(condition123.length()>0){
				condition123 += "and `name` like '"+name+"' ";
			}else{
				condition123 += "`name` like '"+name+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orNameLike(String name){
		if(name!=null&&name.trim().length()>0&&!("%".equals(name.trim()))&&!("%%".equals(name.trim()))){
			if(condition123.length()>0){
				condition123 += "or `name` like '"+name+"' ";
			}else{
				condition123 += "`name` like '"+name+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andNameIsNull(){
			if(condition123.length()>0){
				condition123 += "and `name` is null";
			}else{
				condition123 += "`name` is null";
			}
		return this;
	}
	public BannerCriteria orNameIsNull(){
		if(condition123.length()>0){
			condition123 += "or `name` is null";
		}else{
			condition123 += "`name` is null";
		}
		return this;
	}
	public BannerCriteria andNameIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `name` is not null";
		}else{
			condition123 += "`name` is not null";
		}
		return this;
	}
	public BannerCriteria orNameIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `name` is not null";
		}else{
			condition123 += "`name` is not null";
		}
		return this;
	}
	
	public BannerCriteria andNameIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `name` in("+value+") ";
			}else{
				condition123 += "`name` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orNameIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `name` in("+value+") ";
			}else{
				condition123 += "`name` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andNameNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `name` not in("+value+") ";
			}else{
				condition123 += "`name` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orNameNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `name` not in("+value+") ";
			}else{
				condition123 += "`name` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andLocationEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `location`='"+location+"' ";
			}else{
				condition123 += "`location`='"+location+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orLocationEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `location`='"+location+"' ";
			}else{
				condition123 += "`location`='"+location+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLocationNotEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `location`!='"+location+"' ";
			}else{
				condition123 += "`location`!='"+location+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLocationNotEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `location`!='"+location+"' ";
			}else{
				condition123 += "`location`!='"+location+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andLocationGreaterThan(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `location`>'"+location+"' ";
			}else{
				condition123 += "`location`>'"+location+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLocationGreaterThan(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `location`>'"+location+"' ";
			}else{
				condition123 += "`location`>'"+location+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andLocationLessThan(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `location`<'"+location+"' ";
			}else{
				condition123 += "`location`<'"+location+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLocationLessThan(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `location`<'"+location+"' ";
			}else{
				condition123 += "`location`<'"+location+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLocationGreadterThanAndEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `location`>='"+location+"' ";
			}else{
				condition123 += "`location`>='"+location+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLocationGreadterThanAndEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `location`>='"+location+"' ";
			}else{
				condition123 += "`location`>='"+location+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLocationLessThanAndEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `location`<='"+location+"' ";
			}else{
				condition123 += "`location`<='"+location+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLocationLessThanAndEquals(String location){
		if(location!=null&&location.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `location`<='"+location+"' ";
			}else{
				condition123 += "`location`<='"+location+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLocationLike(String location){
		if(location!=null&&location.trim().length()>0&&!("%".equals(location.trim()))&&!("%%".equals(location.trim()))){
			if(condition123.length()>0){
				condition123 += "and `location` like '"+location+"' ";
			}else{
				condition123 += "`location` like '"+location+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLocationLike(String location){
		if(location!=null&&location.trim().length()>0&&!("%".equals(location.trim()))&&!("%%".equals(location.trim()))){
			if(condition123.length()>0){
				condition123 += "or `location` like '"+location+"' ";
			}else{
				condition123 += "`location` like '"+location+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLocationIsNull(){
			if(condition123.length()>0){
				condition123 += "and `location` is null";
			}else{
				condition123 += "`location` is null";
			}
		return this;
	}
	public BannerCriteria orLocationIsNull(){
		if(condition123.length()>0){
			condition123 += "or `location` is null";
		}else{
			condition123 += "`location` is null";
		}
		return this;
	}
	public BannerCriteria andLocationIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `location` is not null";
		}else{
			condition123 += "`location` is not null";
		}
		return this;
	}
	public BannerCriteria orLocationIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `location` is not null";
		}else{
			condition123 += "`location` is not null";
		}
		return this;
	}
	
	public BannerCriteria andLocationIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `location` in("+value+") ";
			}else{
				condition123 += "`location` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orLocationIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `location` in("+value+") ";
			}else{
				condition123 += "`location` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLocationNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `location` not in("+value+") ";
			}else{
				condition123 += "`location` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orLocationNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `location` not in("+value+") ";
			}else{
				condition123 += "`location` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andLinkEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `link`='"+link+"' ";
			}else{
				condition123 += "`link`='"+link+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orLinkEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `link`='"+link+"' ";
			}else{
				condition123 += "`link`='"+link+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLinkNotEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `link`!='"+link+"' ";
			}else{
				condition123 += "`link`!='"+link+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLinkNotEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `link`!='"+link+"' ";
			}else{
				condition123 += "`link`!='"+link+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andLinkGreaterThan(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `link`>'"+link+"' ";
			}else{
				condition123 += "`link`>'"+link+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLinkGreaterThan(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `link`>'"+link+"' ";
			}else{
				condition123 += "`link`>'"+link+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andLinkLessThan(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `link`<'"+link+"' ";
			}else{
				condition123 += "`link`<'"+link+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLinkLessThan(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `link`<'"+link+"' ";
			}else{
				condition123 += "`link`<'"+link+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLinkGreadterThanAndEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `link`>='"+link+"' ";
			}else{
				condition123 += "`link`>='"+link+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLinkGreadterThanAndEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `link`>='"+link+"' ";
			}else{
				condition123 += "`link`>='"+link+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLinkLessThanAndEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `link`<='"+link+"' ";
			}else{
				condition123 += "`link`<='"+link+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLinkLessThanAndEquals(String link){
		if(link!=null&&link.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `link`<='"+link+"' ";
			}else{
				condition123 += "`link`<='"+link+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLinkLike(String link){
		if(link!=null&&link.trim().length()>0&&!("%".equals(link.trim()))&&!("%%".equals(link.trim()))){
			if(condition123.length()>0){
				condition123 += "and `link` like '"+link+"' ";
			}else{
				condition123 += "`link` like '"+link+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orLinkLike(String link){
		if(link!=null&&link.trim().length()>0&&!("%".equals(link.trim()))&&!("%%".equals(link.trim()))){
			if(condition123.length()>0){
				condition123 += "or `link` like '"+link+"' ";
			}else{
				condition123 += "`link` like '"+link+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLinkIsNull(){
			if(condition123.length()>0){
				condition123 += "and `link` is null";
			}else{
				condition123 += "`link` is null";
			}
		return this;
	}
	public BannerCriteria orLinkIsNull(){
		if(condition123.length()>0){
			condition123 += "or `link` is null";
		}else{
			condition123 += "`link` is null";
		}
		return this;
	}
	public BannerCriteria andLinkIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `link` is not null";
		}else{
			condition123 += "`link` is not null";
		}
		return this;
	}
	public BannerCriteria orLinkIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `link` is not null";
		}else{
			condition123 += "`link` is not null";
		}
		return this;
	}
	
	public BannerCriteria andLinkIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `link` in("+value+") ";
			}else{
				condition123 += "`link` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orLinkIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `link` in("+value+") ";
			}else{
				condition123 += "`link` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andLinkNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `link` not in("+value+") ";
			}else{
				condition123 += "`link` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orLinkNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `link` not in("+value+") ";
			}else{
				condition123 += "`link` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andImgSrcEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `img_src`='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`='"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orImgSrcEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `img_src`='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`='"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andImgSrcNotEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `img_src`!='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`!='"+imgSrc+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orImgSrcNotEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `img_src`!='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`!='"+imgSrc+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andImgSrcGreaterThan(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `img_src`>'"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`>'"+imgSrc+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orImgSrcGreaterThan(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `img_src`>'"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`>'"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andImgSrcLessThan(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `img_src`<'"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`<'"+imgSrc+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orImgSrcLessThan(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `img_src`<'"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`<'"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andImgSrcGreadterThanAndEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `img_src`>='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`>='"+imgSrc+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orImgSrcGreadterThanAndEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `img_src`>='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`>='"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andImgSrcLessThanAndEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `img_src`<='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`<='"+imgSrc+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orImgSrcLessThanAndEquals(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `img_src`<='"+imgSrc+"' ";
			}else{
				condition123 += "`img_src`<='"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andImgSrcLike(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0&&!("%".equals(imgSrc.trim()))&&!("%%".equals(imgSrc.trim()))){
			if(condition123.length()>0){
				condition123 += "and `img_src` like '"+imgSrc+"' ";
			}else{
				condition123 += "`img_src` like '"+imgSrc+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orImgSrcLike(String imgSrc){
		if(imgSrc!=null&&imgSrc.trim().length()>0&&!("%".equals(imgSrc.trim()))&&!("%%".equals(imgSrc.trim()))){
			if(condition123.length()>0){
				condition123 += "or `img_src` like '"+imgSrc+"' ";
			}else{
				condition123 += "`img_src` like '"+imgSrc+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andImgSrcIsNull(){
			if(condition123.length()>0){
				condition123 += "and `img_src` is null";
			}else{
				condition123 += "`img_src` is null";
			}
		return this;
	}
	public BannerCriteria orImgSrcIsNull(){
		if(condition123.length()>0){
			condition123 += "or `img_src` is null";
		}else{
			condition123 += "`img_src` is null";
		}
		return this;
	}
	public BannerCriteria andImgSrcIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `img_src` is not null";
		}else{
			condition123 += "`img_src` is not null";
		}
		return this;
	}
	public BannerCriteria orImgSrcIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `img_src` is not null";
		}else{
			condition123 += "`img_src` is not null";
		}
		return this;
	}
	
	public BannerCriteria andImgSrcIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `img_src` in("+value+") ";
			}else{
				condition123 += "`img_src` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orImgSrcIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `img_src` in("+value+") ";
			}else{
				condition123 += "`img_src` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andImgSrcNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `img_src` not in("+value+") ";
			}else{
				condition123 += "`img_src` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orImgSrcNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `img_src` not in("+value+") ";
			}else{
				condition123 += "`img_src` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andIndexEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`='"+index+"' ";
			}else{
				condition123 += "`index`='"+index+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orIndexEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`='"+index+"' ";
			}else{
				condition123 += "`index`='"+index+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIndexNotEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`!='"+index+"' ";
			}else{
				condition123 += "`index`!='"+index+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orIndexNotEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`!='"+index+"' ";
			}else{
				condition123 += "`index`!='"+index+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andIndexGreaterThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`>'"+index+"' ";
			}else{
				condition123 += "`index`>'"+index+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orIndexGreaterThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`>'"+index+"' ";
			}else{
				condition123 += "`index`>'"+index+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andIndexLessThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`<'"+index+"' ";
			}else{
				condition123 += "`index`<'"+index+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orIndexLessThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`<'"+index+"' ";
			}else{
				condition123 += "`index`<'"+index+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIndexGreadterThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`>='"+index+"' ";
			}else{
				condition123 += "`index`>='"+index+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orIndexGreadterThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`>='"+index+"' ";
			}else{
				condition123 += "`index`>='"+index+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIndexLessThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`<='"+index+"' ";
			}else{
				condition123 += "`index`<='"+index+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orIndexLessThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`<='"+index+"' ";
			}else{
				condition123 += "`index`<='"+index+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIndexLike(String index){
		if(index!=null&&index.trim().length()>0&&!("%".equals(index.trim()))&&!("%%".equals(index.trim()))){
			if(condition123.length()>0){
				condition123 += "and `index` like '"+index+"' ";
			}else{
				condition123 += "`index` like '"+index+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orIndexLike(String index){
		if(index!=null&&index.trim().length()>0&&!("%".equals(index.trim()))&&!("%%".equals(index.trim()))){
			if(condition123.length()>0){
				condition123 += "or `index` like '"+index+"' ";
			}else{
				condition123 += "`index` like '"+index+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIndexIsNull(){
			if(condition123.length()>0){
				condition123 += "and `index` is null";
			}else{
				condition123 += "`index` is null";
			}
		return this;
	}
	public BannerCriteria orIndexIsNull(){
		if(condition123.length()>0){
			condition123 += "or `index` is null";
		}else{
			condition123 += "`index` is null";
		}
		return this;
	}
	public BannerCriteria andIndexIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `index` is not null";
		}else{
			condition123 += "`index` is not null";
		}
		return this;
	}
	public BannerCriteria orIndexIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `index` is not null";
		}else{
			condition123 += "`index` is not null";
		}
		return this;
	}
	
	public BannerCriteria andIndexIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `index` in("+value+") ";
			}else{
				condition123 += "`index` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orIndexIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `index` in("+value+") ";
			}else{
				condition123 += "`index` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andIndexNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `index` not in("+value+") ";
			}else{
				condition123 += "`index` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orIndexNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `index` not in("+value+") ";
			}else{
				condition123 += "`index` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andCreateDateEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`='"+createDate+"' ";
			}else{
				condition123 += "`create_date`='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orCreateDateEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`='"+createDate+"' ";
			}else{
				condition123 += "`create_date`='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andCreateDateNotEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`!='"+createDate+"' ";
			}else{
				condition123 += "`create_date`!='"+createDate+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orCreateDateNotEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`!='"+createDate+"' ";
			}else{
				condition123 += "`create_date`!='"+createDate+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andCreateDateGreaterThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`>'"+createDate+"' ";
			}else{
				condition123 += "`create_date`>'"+createDate+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orCreateDateGreaterThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`>'"+createDate+"' ";
			}else{
				condition123 += "`create_date`>'"+createDate+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andCreateDateLessThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`<'"+createDate+"' ";
			}else{
				condition123 += "`create_date`<'"+createDate+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orCreateDateLessThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`<'"+createDate+"' ";
			}else{
				condition123 += "`create_date`<'"+createDate+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andCreateDateGreadterThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`>='"+createDate+"' ";
			}else{
				condition123 += "`create_date`>='"+createDate+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orCreateDateGreadterThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`>='"+createDate+"' ";
			}else{
				condition123 += "`create_date`>='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andCreateDateLessThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`<='"+createDate+"' ";
			}else{
				condition123 += "`create_date`<='"+createDate+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orCreateDateLessThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`<='"+createDate+"' ";
			}else{
				condition123 += "`create_date`<='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andCreateDateLike(String createDate){
		if(createDate!=null&&createDate.trim().length()>0&&!("%".equals(createDate.trim()))&&!("%%".equals(createDate.trim()))){
			if(condition123.length()>0){
				condition123 += "and `create_date` like '"+createDate+"' ";
			}else{
				condition123 += "`create_date` like '"+createDate+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orCreateDateLike(String createDate){
		if(createDate!=null&&createDate.trim().length()>0&&!("%".equals(createDate.trim()))&&!("%%".equals(createDate.trim()))){
			if(condition123.length()>0){
				condition123 += "or `create_date` like '"+createDate+"' ";
			}else{
				condition123 += "`create_date` like '"+createDate+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andCreateDateIsNull(){
			if(condition123.length()>0){
				condition123 += "and `create_date` is null";
			}else{
				condition123 += "`create_date` is null";
			}
		return this;
	}
	public BannerCriteria orCreateDateIsNull(){
		if(condition123.length()>0){
			condition123 += "or `create_date` is null";
		}else{
			condition123 += "`create_date` is null";
		}
		return this;
	}
	public BannerCriteria andCreateDateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `create_date` is not null";
		}else{
			condition123 += "`create_date` is not null";
		}
		return this;
	}
	public BannerCriteria orCreateDateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `create_date` is not null";
		}else{
			condition123 += "`create_date` is not null";
		}
		return this;
	}
	
	public BannerCriteria andCreateDateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `create_date` in("+value+") ";
			}else{
				condition123 += "`create_date` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orCreateDateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `create_date` in("+value+") ";
			}else{
				condition123 += "`create_date` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andCreateDateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `create_date` not in("+value+") ";
			}else{
				condition123 += "`create_date` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orCreateDateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `create_date` not in("+value+") ";
			}else{
				condition123 += "`create_date` not in("+value+") ";
			}
		}
		return this;
	}

	public BannerCriteria andStateEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`='"+state+"' ";
			}else{
				condition123 += "`state`='"+state+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria orStateEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`='"+state+"' ";
			}else{
				condition123 += "`state`='"+state+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andStateNotEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`!='"+state+"' ";
			}else{
				condition123 += "`state`!='"+state+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orStateNotEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`!='"+state+"' ";
			}else{
				condition123 += "`state`!='"+state+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public BannerCriteria andStateGreaterThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`>'"+state+"' ";
			}else{
				condition123 += "`state`>'"+state+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orStateGreaterThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`>'"+state+"' ";
			}else{
				condition123 += "`state`>'"+state+"' ";
			}
		}
		return this;
	}
	
	
	public BannerCriteria andStateLessThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`<'"+state+"' ";
			}else{
				condition123 += "`state`<'"+state+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orStateLessThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`<'"+state+"' ";
			}else{
				condition123 += "`state`<'"+state+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andStateGreadterThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`>='"+state+"' ";
			}else{
				condition123 += "`state`>='"+state+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orStateGreadterThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`>='"+state+"' ";
			}else{
				condition123 += "`state`>='"+state+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andStateLessThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`<='"+state+"' ";
			}else{
				condition123 += "`state`<='"+state+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orStateLessThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`<='"+state+"' ";
			}else{
				condition123 += "`state`<='"+state+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andStateLike(String state){
		if(state!=null&&state.trim().length()>0&&!("%".equals(state.trim()))&&!("%%".equals(state.trim()))){
			if(condition123.length()>0){
				condition123 += "and `state` like '"+state+"' ";
			}else{
				condition123 += "`state` like '"+state+"' ";
			}
		}
		return this;
	}
	public BannerCriteria orStateLike(String state){
		if(state!=null&&state.trim().length()>0&&!("%".equals(state.trim()))&&!("%%".equals(state.trim()))){
			if(condition123.length()>0){
				condition123 += "or `state` like '"+state+"' ";
			}else{
				condition123 += "`state` like '"+state+"' ";
			}
		}
		return this;
	}
	
	public BannerCriteria andStateIsNull(){
			if(condition123.length()>0){
				condition123 += "and `state` is null";
			}else{
				condition123 += "`state` is null";
			}
		return this;
	}
	public BannerCriteria orStateIsNull(){
		if(condition123.length()>0){
			condition123 += "or `state` is null";
		}else{
			condition123 += "`state` is null";
		}
		return this;
	}
	public BannerCriteria andStateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `state` is not null";
		}else{
			condition123 += "`state` is not null";
		}
		return this;
	}
	public BannerCriteria orStateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `state` is not null";
		}else{
			condition123 += "`state` is not null";
		}
		return this;
	}
	
	public BannerCriteria andStateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `state` in("+value+") ";
			}else{
				condition123 += "`state` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orStateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `state` in("+value+") ";
			}else{
				condition123 += "`state` in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria andStateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `state` not in("+value+") ";
			}else{
				condition123 += "`state` not in("+value+") ";
			}
		}
		return this;
	}
	
	public BannerCriteria orStateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `state` not in("+value+") ";
			}else{
				condition123 += "`state` not in("+value+") ";
			}
		}
		return this;
	}

	private void initBanner(Banner banner) {
		super.setId(banner.getId());
		super.setName(banner.getName());
		super.setLocation(banner.getLocation());
		super.setLink(banner.getLink());
		super.setImgSrc(banner.getImgSrc());
		super.setIndex(banner.getIndex());
		super.setCreateDate(banner.getCreateDate());
		super.setState(banner.getState());

	}

}